package delegated_property

import kotlin.properties.Delegates

//observable代理 监听修改的值但不能影响修改的结果

fun main(args: Array<String>) {
    val user = ObserverSimple()
    user.observerObj = "4545"
    user.observerObj = "45687"
}

//class
class ObserverSimple{
    var observerObj : String by Delegates.observable("zhuzhuzhu") {
        d, old, new ->
        println("${d.name}-$old - $new")
    }
}